
class Solution {
public:
    int diagonalSum(vector<vector<int>>& mat) {
        int n = mat.size();
        int ret = 0;
        
        for(int i = 0;i < n;i++){
            ret += mat[i][i];
        }

        for(int i = 0; i < n;i++){
            if(i != n - 1 - i) ret += mat[i][n-1-i];
        }

        return ret;
    }
};